﻿<%@ Page Title="" Language="C#" MasterPageFile="~/HomePage.master" AutoEventWireup="true"
    CodeFile="Tim-Kiem-Van-Chuyen.aspx.cs" Inherits="Tim_Kiem_Van_Chuyen" %>

<%@ Register Assembly="PagerControl" Namespace="CutePager" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<title><%= Common.title %></title>
    <style>
        /*  */
        div#mainwrapper
        {
            font-family: Tahoma, Arial;
            font-size: 12px;
        }
        
        /* Border grid  */
        div#mainwrapper div#boxgrid
        {
            border: 1px solid red;
        }
        
        /* Xử lý Hover qua ảnh  */
        div#mainwrapper div#boxgrid div#nav
        {
            position: relative;
        }
        div#mainwrapper div#boxgrid div#nav img
        {
            width: 80px;
            height: 50px;
            cursor: pointer;
        }
        
        div#mainwrapper div#boxgrid div#nav p img
        {
            width: 400px;
            height: 300px;
            border-radius: 5px;
        }
        
        div#mainwrapper div#boxgrid div#nav p
        {
            position: absolute;
            display: none;
            border: 1px solid red;
            border-radius: 5px;
        }
        
        /* Group loại */
        .GroupHeaderStyle
        {
            background: red url('Images/dltn/bgheader.png');
            font-weight: bold;
            color: white;
            text-align: center;
        }
        
        /* Group tiêu đề */
        .GroupTitleStyle
        {
            background: #6666FF;
            text-align: center;
            font-weight: bold;
            color: white;
            border-bottom-width: 4px;
        }
        
        /* Button đặt xe */
        .DatXeStyle
        {
            border-radius: 8px;
            font-weight: bold;
            background: red url(Images/dltn/bgheader.png) repeat;
            color: white;
            cursor: pointer;
            text-align: center;
            width: 60px;
            height: 25px;
            padding-top: 8px;
        }
        .TextDatXeStyle 
        {
            padding-top: 10px;
          text-decoration: none;
            color: white;

        }
    </style>
    <!-- Include Script -->
    <script src="Scripts/jquery-1.1.3.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            // Xử lý khi chuột di chuyển
            $('div#mainwrapper div#boxgrid div#nav').mousemove(
                function (e) {
                    $(this).find('p')
                        .css(
                            {
                                display: 'block',
                                position: 'absolute',
                                left: e.pageX - 150,
                                top: -250,
                                background: '#ffe'
                            }
                        ).stop();
                }
            );

            // Xử lý khi chuột ra ngoài
            $('div#mainwrapper div#boxgrid div#nav').mouseleave(
                function () {
                    $(this).find('p').css({ display: 'none' }).stop();
                }
            );
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<div id="border">
    <div id="mainwrapper">
        <p class="msg"><asp:Literal ID="ltrMessage"  runat="server" Visible="true"></asp:Literal></p>
        <%
            if (ltrMessage.Visible == true)
            {    
        %>
                <div id="boxgrid" style="border:none;"></div>                
        <%  }
            else
            { 
        %>
        <div id="boxgrid">
            <asp:GridView ID="GrdTransport" AutoGenerateColumns="False" TabIndex="1" CellPadding="4"
                Width="100%" GridLines="Vertical" runat="server" AutoGenerateSelectButton="False" OnRowCreated="GrdTransport_RowCreated"
                ShowHeader="False" OnRowDataBound="GrdTransport_RowDataBound" EnableModelValidation="True"
                OnRowCommand="GrdTransport_RowCommand">
                <Columns>
                    <asp:TemplateField HeaderText="Ảnh đại diện" ItemStyle-Width="20%">
                        <ItemTemplate>
                            <div id="nav">
                                <asp:Image ID="imgAnhDaiDien" runat="server" ImageUrl='<%#"~/Upload/VanChuyen/" + Eval("AnhDaiDien")%>' />
                                <p>
                                    <asp:Image ID="Image1" runat="server" CssClass="hidden" ImageUrl='<%#"~/Upload/VanChuyen/" + Eval("AnhDaiDien")%>' />
                                </p>
                            </div>
                        </ItemTemplate>
                        <ItemStyle Width="20%" HorizontalAlign="Center" VerticalAlign="Middle"></ItemStyle>
                    </asp:TemplateField>
                    <asp:BoundField DataField="TenXe" HeaderText="Tên xe">
                        <ItemStyle Width="40%" HorizontalAlign="Left" VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:BoundField DataField="NhaSanXuat" HeaderText="Nhà sản xuất">
                        <ItemStyle Width="20%" HorizontalAlign="Left" VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:TemplateField ItemStyle-Width="20%">
                        <ItemTemplate>
                            <div class="DatXeStyle">
                            <asp:HyperLink  Text="Đặt Xe" runat="server" CssClass ="TextDatXeStyle" NavigateUrl='<%# "~/" + Eval("Id") + "_Van-Chuyen.aspx" %>'  ></asp:HyperLink>
                            </div>
                        </ItemTemplate>
                        <ItemStyle Width="20%" HorizontalAlign="Center" VerticalAlign="Middle"></ItemStyle>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
        <div>
            <cc1:Pager ID="Pager1" runat="server" PreviousClause="Lùi" NextClause=" Tiến " LastClause=""
                FirstClause="" PageClause="Trang " OfClause="/" PageSize="10" OnCommand="Pager1_Command"
                ForeColor="#006600" Font-Bold="True" />
        </div>
        <%} %>
    </div>
    <div style="clear:both"></div>
</div>
</asp:Content>
